# coding=utf-8
from robot.api.deco import keyword

import requests  # pip安装requests第三方库，然后引入
import json  # 引入json标准库，美化json输出


@keyword("POST On Session")
def send_post(url, data):
    headers = {
        "content-type": "application/json"
    }
    result = requests.post(url=url, data=json.dumps(data), headers=headers).json()
    res = json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2)
    print(res)
